﻿using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using UnityEngine;
using UnityEngine.UI;

namespace com.tdb.foundation
{
    public class ModalDialog : MonoBehaviour
    {
        [SerializeField]
        private GameObject _btnGroup;
        [SerializeField]
        private Text _content;
        [SerializeField]
        private Button _leftButton,_rightButton;

        void Awake()
        {
            DontDestroyOnLoad(this);
        }


        void OnEnable()
        {
            transform.DOKill();
            transform.DOScale(Vector3.one, .5f);
        }

        private void OnDisable()
        {
            transform.DOScale(Vector3.zero, .5f);
        }

        public void ShowTips(string tips)
        {
            _content.text = tips;
            _btnGroup.SetActive(false);
            gameObject.SetActive(true);
            DOVirtual.DelayedCall(1f, () =>
            {
                gameObject.SetActive(false);
            });
        
        }

        public void ShowSingleBtn(string tips, string btnText, string onClick)
        {
        
        }
    }
}

